﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>替换当前文档</title>
    <script>
        function replaceDoc() {
            window.location.replace("http://www.baidu.com");
        }
    </script>
</head>
<body>
    <input type="button" value="载入新文档替换当前页面" onclick="replaceDoc();" />
</body>
</html>